home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / GFXFX2.ZIP / MODEX.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  2KB  |  42 lines

  1.  
  2. program mode_x; { MODEX.PAS }
  3. { Small demo of the mode-x unit, by Bas van Gaalen }
  4. { Commandline-parameter: bots.pcx }
  5. uses u_ffpcx,u_vga,u_mdx,u_pal,u_kb;
  6. var pcxpal:pal_type; pcxpic:pointer; i:byte;
  7. begin
  8.   getmem(pcxpic,320*200);
  9.   if pcx_load(paramstr(1),pcxpic,pcxpal)<>pcx_ok then begin
  10.     writeln('An error ocured: ',pcx_errstr); halt; end;
  11.   mdx_setmodex(mdx_320x200,640); { set mode-x, 320x200x256x4 }
  12.   setpal(pcxpal);
  13.   mdx_setcoords(0,200);
  14.   mdx_displaypic(0,200,pcxpic,320,200); { display pcx-picture in 3rd quadrant }
  15.   getfont(font8x16);
  16.   mdx_writetxt('Hi world!',340,220,15); { write text in 4th quadrant }
  17.   mdx_fill(0,0,320,199,blue); { fill first screen with blue background }
  18.   getfont(font8x8);
  19.   mdx_writetxt('This is page number one.',5,10,15); { write text in 1st quad }
  20.   mdx_writetxt('Try to figure that out! :-)',5,18,15);
  21.   mdx_writetxt('Note the _smooth_ horizontal',5,40,7);
  22.   mdx_writetxt('scrolling without disturbance',5,48,7);
  23.   mdx_writetxt('in this part of the screen!',5,56,7);
  24.  
  25.   waitkey(2);
  26.   for i:=199 downto 0 do begin
  27.     if i=50 then waitkey(1);
  28.     vretrace;
  29.     mdx_setsplit(i shl 1); { move 2nd screen up with doubled speed }
  30.     mdx_setcoords(200-i,200); { move 1st screen left }
  31.   end;
  32.   for i:=1 to 200 do begin
  33.     vretrace;
  34.     mdx_setsplit(i shl 1); { move 2nd screen down with doubled speed }
  35.     mdx_setcoords(200-i,200); { move 1st screen right }
  36.   end;
  37.  
  38.   waitkey(0);
  39.   freemem(pcxpic,320*200);
  40.   setvideo(u_lm);
  41. end.
  42.